/**
 * Licensee: Universidad de Almeria
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class DeletePractica1Data {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = agenda.Practica1PersistentManager.instance().getSession().beginTransaction();
		try {
			agenda.Registro lagendaRegistro = agenda.RegistroDAO.loadRegistroByQuery(null, null);
			// Delete the persistent object
			agenda.RegistroDAO.delete(lagendaRegistro);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeletePractica1Data deletePractica1Data = new DeletePractica1Data();
			try {
				deletePractica1Data.deleteTestData();
			}
			finally {
				agenda.Practica1PersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
